package com.ruoyi.common.core.validator;


import com.ruoyi.common.core.annotation.NotNullAndNotBlank;
import com.ruoyi.common.core.utils.StringUtils;
import com.ruoyi.common.group.UpdateGroup;


import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;
import java.util.Arrays;
import java.util.Date;
import java.util.HashSet;
import java.util.Set;

public class NullBlankValidator implements ConstraintValidator<NotNullAndNotBlank,Object> {


    @Override
    public boolean isValid(Object s, ConstraintValidatorContext constraintValidatorContext) {

        if(s==null) return false;

        if (s instanceof String){
            return !StringUtils.isEmpty((String) s);
        }

        return true;

    }
}
